Can you pass a value into a generator using .next(value)? How does that work and what is the practical use case?
Yes, next(value) passes a value into the generator, replacing the result of the last yield expression. Useful for two-way communication and implementing state machines.